﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Mobile.Models;

namespace Mobile.Controllers
{
    public class GuestUIController : Controller
    {
        //private List<MainService.QueueData> Queue = new List<MainService.QueueData>();
        private Queue Queue = new Queue();
        private int count = 0;

       
        //
        // GET: /GuestUI./

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult AddSong()
        {
            return View();
        }

        public ActionResult Playlist()
        {
            MainService.Service service = new MainService.Service();
            //Queue = service.GetQueue("123").ToList();
            Queue.qdList = service.GetQueue("123").ToList();
          
            //ViewData.Add(Queue.qdList.ElementAt(0).Song.SongID, Queue.qdList.ElementAt(0));
            //Queue.qdList.Remove(Queue.qdList.ElementAt(0));
            
            //foreach (MainService.QueueData qd in Queue){
            foreach (MainService.QueueData qd in Queue.qdList){
                if(!ViewData.Keys.Contains(qd.Song.SongID))
                ViewData.Add(qd.Song.SongID, qd);
                count++;
            }
            ViewBag.Value = count;
            count = 0;
        // Need way to order by net votes
            return View();
        }

    }
}
